from  selenium import webdriver
import time

# from selenium.webdriver.common.by import By
# # 1.打开Chroem,打开360首页
# driver = webdriver.Chrome()
# driver.get('https://www.so.com/')
# # 2.搜索框输入'python自动化测试' 点击搜索
# kw = driver.find_element(By.ID, 'input')
# kw.send_keys('python自动化测试')
# su = driver.find_element(By.ID, 'search-button')
# su.click()
# # 3. 获取页面标题, 并打印出来
# time.sleep(3)
# print(driver.title)
# # 4. 检查'python' 关键字是否在标题中
# if 'python' in driver.title:
#     print('找到了')
# else:
#     print('没有找到')
# time.sleep(1)
# driver.quit()
from selenium.webdriver.common.by import By

driver = webdriver.Chrome()
driver.get('https://www.so.com/')

id =driver.find_element(By.ID, 'input')
id.send_keys('美女')
send = driver.find_element(By.ID, 'search-button')
send.click()
time.sleep(2)
if '美女' in driver.title:
    print('检查成功')
else:
    print('检查失败')
driver.quit()




